<?php

namespace app\store\model;

use think\Cache;
use app\common\model\Bankuai as BankuaiModel;

/**
 * 商品板块模型
 */
class Bankuai extends BankuaiModel{
    /**
     * 添加
     */
    public function add($data){
        $data['wxapp_id'] = self::$wxapp_id;
        $data['create_time']=time();
        $data['update_time']=0;
        return $this->allowField(true)->save($data);
    }
    /*
     * 获取列表数据
     */
    public function getAll(){
        $data['wxapp_id'] = self::$wxapp_id;
        return $this->where(['wxapp_id'=>$data['wxapp_id']])->select();
    }
    /**
     * 编辑
     */
    public function edit($data){
        return $this->allowField(true)->save($data) !== false;
    }

    /**
     * 删除
     */
    public function remove($id){
        return $this->where(['id'=>$id])->delete();
    }
}
